/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Project;

import Common.IDocumentCollection;
import Common.IProject;
import Common.IProjectModel;
import Common.IUnitCollection;
import Common.IUnitHolder;

/**
 *
 * @author Администратор
 */
public class Project extends Unit implements IProject, IUnitHolder {

    private DocumentCollection documents = new DocumentCollection();
    private IProjectModel projectModel;

    public Project(IProjectModel projectModel) {
        super(null);
        this.setName("");
        this.setProjectModel(projectModel);
    }

    // <editor-fold defaultstate="collapsed" desc="IProject">
    private void setProjectModel(IProjectModel projectModel) {
        this.projectModel = projectModel;
    }

    public IProjectModel getProjectModel() {
        return this.projectModel;
    }

    public IDocumentCollection getDocuments() {
        return this.documents;
    }

    @Override
    public String getUnitType() {
        return this.toString();
    }

    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="IUnitHolder">
    public IUnitHolder AsUnitHolder() {
        return this;
    }

    public IUnitCollection getUnits() {
        return ((IUnitHolder) this.documents).getUnits();
    }
    // </editor-fold>
}
